# coding:utf-8

# l = [3, 2, 3, 7, 8, 1]
# l.count(3)      # 统计3出现的次数
# # 2
# l.index(7)        # 返回7第一次出现的索引
# # 3
# r = l.reverse()       # 原地倒转列表，元组没有该函数
# print(r)  # None
# print(l)
# # [1, 8, 7, 3, 2, 3]
# s = l.sort()             # 原地排序，元组没有该函数
# print(s)  # None
# print(l)
# # [1, 2, 3, 3, 7, 8]
#
# tup = (3, 2, 3, 7, 8, 1)
# tup.count(3)
# # 2
# tup.index(7)
# # 3
# print(reversed(tup))  # <reversed object at 0x7fd12bbaa0f0>
# list(reversed(tup))     # reversed() 返回一个倒转后的迭代器
# # [1, 8, 7, 3, 2, 3]
# print(sorted(tup))
# # [1, 2, 3, 3, 7, 8]           # sorted() 返回排好序的新列表。


l = [1, 2, 3]
print(l.__sizeof__())
print(id(l))
# 64
tup = (1, 2, 3)
print(tup.__sizeof__())
print(id(tup))
# 48

